/**
 * Project Name:ResultMsg.java
 * File Name:ResultMsg.java
 * Date:2019/3/10 17:55
 * Copyright (c) 2019, zhang.xiangyu@foxmail.com All Rights Reserved.
 */
package com.meatball.utils.response;

import lombok.Data;

/**
 * @Title: ResultMsg.java
 * @Description: todo(定义返回分页消息格式)
 * @Author: 張翔宇
 * @Date: 2019/3/10 17:55
 * @Version: V1.0
 */
@Data
public class ResultPageMsg<T> {
    /**
     * 状态码
     */
    private int code;

    /**
     * 消息内容
     */
    private String message;

    /**
     * 总数
     */
    private long count;

    /**
     * 数据信息
     */
    private T data;

    /**
     * @title: ResultMsg
     * @description: todo(带数据返回)
     * @params: [code, message]
     * @return:     返回类型
     * @author: 張翔宇
     * @date: 2019/3/10 17:56
     */
    public ResultPageMsg(int code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * @title: ResultMsg
     * @description: todo(只返回消息)
     * @params: [code, message, data]
     * @return:     返回类型
     * @author: 張翔宇
     * @date: 2019/3/10 17:56
     */
    public ResultPageMsg(int code, String message, long count, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
        this.count = count;
    }
}
